using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using DATA.BusinessObjects;
using DATA.Base;

namespace DATA.ManagerObjects
{
    public partial interface IKhachhangManager : IManagerBase<DATA.BusinessObjects.Khachhang, string>
    {
		// Get Methods
		IList<Khachhang> GetByMaLoaiKhach(System.String loaikhach);
    }

    partial class KhachhangManager : ManagerBase<DATA.BusinessObjects.Khachhang, string>, IKhachhangManager
    {
		#region Constructors
		
		public KhachhangManager() : base()
        {
        }
        public KhachhangManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Khachhang> GetByMaLoaiKhach(System.String loaikhach)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Khachhang));
			
			
			ICriteria loaikhachCriteria = criteria.CreateCriteria("Loaikhach");
            loaikhachCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", loaikhach));
			
			return criteria.List<Khachhang>();
        }
		
		#endregion
    }
}